#ifndef _RTC_H
#define _RTC_H
#include "s3c2440.h"
#include "uart.h"

#define RTCEN   (1 << 0)    //RTC control bit
#define ALMEN   (1 << 6)    //RTC ALARM GLOBAL ENABLE
#define YEARALMEN   (1 << 5)    //
#define MONTHALMEN  (1 << 4)
#define DATEALMEN   (1 << 3)
#define HOURALMEN   (1 << 2)
#define MINUTEALMEN (1 << 1)
#define SECONDALMEN (1 << 0)

typedef struct
{
    unsigned char Year;
    unsigned char Month;
    unsigned char Date;
    unsigned char WeekDay;
    unsigned char Hour;
    unsigned char Minute;
    unsigned char Second;
} TIME_STRUCT;
void RtcWrite(TIME_STRUCT Time);
void RtcRead(TIME_STRUCT *Time);
void SetAlmTime(TIME_STRUCT AlmTime);
#endif


